package org.window;

import javafx.event.EventHandler;
import javafx.scene.control.Button;
import javafx.scene.image.Image;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.*;

/**
 * 首次搜索
 */
public class PaneAndHBoxFrameAndColumnVBoxAndHBoxAndButtonSearchStop {
    public static Button button = new Button();
    public static void init(){
        button.setId("PaneAndHBoxFrameAndColumnVBoxAndHBoxAndButtonSearchStop");
        button.setText("终止搜索");
        button.setPrefWidth(80);
        button.setPrefHeight(30);
        button.setBackground(new Background(new BackgroundImage(new Image("bgk.jpg"), BackgroundRepeat.NO_REPEAT ,BackgroundRepeat.REPEAT, BackgroundPosition.CENTER, BackgroundSize.DEFAULT)));
        button.setStyle("-fx-text-fill: #ffffff");
        button.setDisable(true);
        button.setOnMouseEntered(new EventHandler<MouseEvent>() {
            @Override
            public void handle(MouseEvent event) {
                button.setBackground(new Background(new BackgroundImage(new Image("bgk2.jpg"), BackgroundRepeat.NO_REPEAT ,BackgroundRepeat.REPEAT, BackgroundPosition.CENTER, BackgroundSize.DEFAULT)));
            }
        });
        button.setOnMouseExited(new EventHandler<MouseEvent>() {
            @Override
            public void handle(MouseEvent event) {
                button.setBackground(new Background(new BackgroundImage(new Image("bgk.jpg"), BackgroundRepeat.NO_REPEAT ,BackgroundRepeat.REPEAT, BackgroundPosition.CENTER, BackgroundSize.DEFAULT)));
            }
        });
    }
}
